/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.projetoObras.view;

/**
 *
 * @author Tiago
 */
public class MeasureRegistryView extends javax.swing.JPanel {

    /**
     * Creates new form VisaoCadastroMedida
     */
    private MainFrame m_frame;
    public MeasureRegistryView(MainFrame frame) {
        initComponents();
        m_frame = frame;
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        lbl_suport = new javax.swing.JLabel();
        lbl_height_suport = new javax.swing.JLabel();
        lbl_width_suport = new javax.swing.JLabel();
        lbl_passepartout = new javax.swing.JLabel();
        lbl_height_passepartout = new javax.swing.JLabel();
        lbl_width_passepartout = new javax.swing.JLabel();
        lbl_molding = new javax.swing.JLabel();
        lbl_height_molding = new javax.swing.JLabel();
        lbl_width_molding = new javax.swing.JLabel();
        lbl_width_depth = new javax.swing.JLabel();
        lbl_diameter = new javax.swing.JLabel();
        txt_height_suport = new javax.swing.JTextField();
        txt_width_suport = new javax.swing.JTextField();
        txt_height_passepartout = new javax.swing.JTextField();
        txt_width_passepartout = new javax.swing.JTextField();
        txt_height_molding = new javax.swing.JTextField();
        txt_width_molding = new javax.swing.JTextField();
        txt_depth = new javax.swing.JTextField();
        txt_diameter = new javax.swing.JTextField();
        btn_save = new javax.swing.JButton();
        btn_clear = new javax.swing.JButton();
        btn_cancel = new javax.swing.JButton();

        lbl_suport.setText("Suporte");

        lbl_height_suport.setText("Altura");

        lbl_width_suport.setText("Largura");

        lbl_passepartout.setText("Passepartout");

        lbl_height_passepartout.setText("Altura");

        lbl_width_passepartout.setText("Largura");

        lbl_molding.setText("Moldura");

        lbl_height_molding.setText("Altura");

        lbl_width_molding.setText("Largura");

        lbl_width_depth.setText("Profundidade");

        lbl_diameter.setText("Diâmetro");

        txt_height_passepartout.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txt_height_passepartoutActionPerformed(evt);
            }
        });

        txt_depth.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txt_depthActionPerformed(evt);
            }
        });

        btn_save.setText("Salvar");

        btn_clear.setText("Limpar");
        btn_clear.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_clearActionPerformed(evt);
            }
        });

        btn_cancel.setText("Cancelar");
        btn_cancel.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_cancelActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lbl_suport)
                    .addComponent(lbl_molding)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                    .addComponent(lbl_height_molding)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(lbl_width_molding))
                                .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                    .addComponent(lbl_height_passepartout)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(lbl_width_passepartout))
                                .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                    .addComponent(lbl_height_suport)
                                    .addGap(59, 59, 59)
                                    .addComponent(lbl_width_suport)))
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(txt_height_molding, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(lbl_diameter))
                                .addGap(18, 18, 18)
                                .addComponent(txt_width_molding, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGap(18, 18, 18)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(lbl_width_depth)
                            .addComponent(txt_depth, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(txt_height_passepartout)
                            .addComponent(lbl_passepartout, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(txt_height_suport, javax.swing.GroupLayout.Alignment.LEADING))
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addGroup(layout.createSequentialGroup()
                                .addGap(19, 19, 19)
                                .addComponent(txt_width_suport, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(layout.createSequentialGroup()
                                .addGap(18, 18, 18)
                                .addComponent(txt_width_passepartout))))
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(txt_diameter, javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(btn_save, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(btn_clear)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(btn_cancel)))
                .addContainerGap(251, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(41, 41, 41)
                .addComponent(lbl_suport)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lbl_height_suport)
                    .addComponent(lbl_width_suport))
                .addGap(2, 2, 2)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txt_height_suport, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txt_width_suport, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(lbl_passepartout)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lbl_height_passepartout)
                    .addComponent(lbl_width_passepartout))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txt_height_passepartout, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txt_width_passepartout, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(lbl_molding)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lbl_height_molding)
                    .addComponent(lbl_width_molding)
                    .addComponent(lbl_width_depth))
                .addGap(3, 3, 3)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txt_height_molding, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txt_width_molding, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txt_depth, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(12, 12, 12)
                .addComponent(lbl_diameter)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(txt_diameter, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 14, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btn_save)
                    .addComponent(btn_clear)
                    .addComponent(btn_cancel))
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents

    private void btn_cancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_cancelActionPerformed
        m_frame.getMain_panel().remove(this);
        m_frame.repaint();
        m_frame.show();
    }//GEN-LAST:event_btn_cancelActionPerformed

    private void txt_height_passepartoutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txt_height_passepartoutActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txt_height_passepartoutActionPerformed

    private void txt_depthActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txt_depthActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txt_depthActionPerformed

    private void btn_clearActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_clearActionPerformed
        clear();
    }//GEN-LAST:event_btn_clearActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btn_cancel;
    private javax.swing.JButton btn_clear;
    private javax.swing.JButton btn_save;
    private javax.swing.JLabel lbl_diameter;
    private javax.swing.JLabel lbl_height_molding;
    private javax.swing.JLabel lbl_height_passepartout;
    private javax.swing.JLabel lbl_height_suport;
    private javax.swing.JLabel lbl_molding;
    private javax.swing.JLabel lbl_passepartout;
    private javax.swing.JLabel lbl_suport;
    private javax.swing.JLabel lbl_width_depth;
    private javax.swing.JLabel lbl_width_molding;
    private javax.swing.JLabel lbl_width_passepartout;
    private javax.swing.JLabel lbl_width_suport;
    private javax.swing.JTextField txt_depth;
    private javax.swing.JTextField txt_diameter;
    private javax.swing.JTextField txt_height_molding;
    private javax.swing.JTextField txt_height_passepartout;
    private javax.swing.JTextField txt_height_suport;
    private javax.swing.JTextField txt_width_molding;
    private javax.swing.JTextField txt_width_passepartout;
    private javax.swing.JTextField txt_width_suport;
    // End of variables declaration//GEN-END:variables

    public void clear(){
        txt_depth.setText(null);
        txt_diameter.setText(null);
        txt_height_molding.setText(null);
        txt_height_passepartout.setText(null);
        txt_height_suport.setText(null);
        txt_width_molding.setText(null);
        txt_width_passepartout.setText(null);
        txt_width_suport.setText(null);
    }
}
